<template>
	<view>
		<view v-if="show" class="flex flex-column bg-white p-4" style="border-bottom: 4rpx solid #eee;width: 2000rpx;">
			<view class="flex align-center mt-1" style="width: 70%;justify-content: space-around;">
				<view v-for="(item,index) in RightTopNav" :key="index" @click="select(index)"
					:class="active==index?'active':''" class="pb-2 px-2">
					<text class="font-weight-bold font-lg">{{item.name}}</text>
					<text class="font-weight-bold font-lg" style="color: red;"> {{item.num}}</text>
				</view>
			</view>
			<!-- 交易日期 -->
			<view class="flex py-3 px-2">
				<view class="flex align-center mr-4">
					<text class="mr-1">交易开始日期:</text>
					<view style="width: 500rpx;">
						<uni-datetime-picker type="date" :clear-icon="false" v-model="single" @maskClick="maskClick" />
					</view>
				</view>
				<view class="flex align-center">
					<text class="mr-1">交易结束日期:</text>
					<view style="width: 500rpx;">
						<uni-datetime-picker type="date" :clear-icon="false" v-model="single" @maskClick="maskClick" />
					</view>
				</view>
			</view>
			<!-- 合同搜索 -->
			<view class="px-2">
				<view class="flex justify-between align-center" style="border: 2rpx solid rgb(221,221,211);width: 70%;">
					<input class="px-2" style="width: 80%;" type="text" placeholder-class="p-1 font-sm"
						placeholder="请输入 合同号/内部合同号/客户名称/单价(元)/订单量(吨)进行搜索">
					<view class="bg-orange text-white font-sm flex justify-center align-center px-3"
						style="height: 60rpx;cursor: pointer;">
						合同搜索
					</view>
				</view>
			</view>
			<!-- 表格 -->
			<view class="mt-2 flex flex-column">
				<view class="w-100 flex font-sm font-weight-bold"
					style="background-color: rgb(245,245,245);height: 80rpx;">
					<view class="text-center" style="width: 20%;line-height: 80rpx;">
						<text>所属企业</text>
					</view>
					<view class="text-center" style="width: 14%;line-height: 80rpx;">
						<text>商品信息</text>
					</view>
					<view class=" text-center" style="width: 10%;line-height: 80rpx;">
						<text>商品价格</text>
					</view>
					<view class=" text-center" style="width: 14%;line-height: 80rpx;">
						<text>交易数量</text>
					</view>
					<view class=" text-center" style="width: 8%;line-height: 80rpx;">
						<text>付款方式</text>
					</view>
					<view class=" text-center" style="width: 10%;line-height: 80rpx;">
						<text>交易状态</text>
					</view>
					<view class="text-center" style="width: 8%;line-height: 80rpx;">
						<text>是否完成付款</text>
					</view>
					<view class=" text-center" style="width: 16%;line-height: 80rpx;">
						<text>交易操作</text>
					</view>
				</view>
				<view class="flex font-sm w-100" style="height: 150rpx;border-bottom:2rpx solid rgb(221,221,211);"
					v-for="(item,index) in NewListData" :key="item.id">
					<view class=" flex justify-center align-center" style="width: 20%;line-height: 70rpx;">
						<view class="w-100 text-ellipsis flex justify-center">
							<text>{{item.Enterprise_Name}}</text>
						</view>
					</view>
					<view class=" flex justify-center align-center" style="width: 14%;line-height: 70rpx;">
						<image style="width: 100rpx;height: 100rpx;" :src="Domain_IMG+item.Picture_URL"></image>
						<text>{{item.Article_Name}}</text>
					</view>
					<view class=" flex justify-center align-center" style="width: 10%;line-height: 70rpx;">
						<view class="flex justify-center">
							<text class="text-orange">￥{{item.Amount}}</text>
							<text> / {{item.Article_Unit_SerialNumber}}</text>
						</view>
					</view>
					<view class="flex align-center justify-center" style="width: 14%;line-height: 70rpx;">
						<text>{{item.Quantity}}{{item.Article_Unit_SerialNumber}}</text>
					</view>
					<view class="flex align-center justify-center" style="width: 8%;line-height: 70rpx;">
						<text>按阶段付款</text>
					</view>
					<view class="flex align-center justify-center" style="width: 10%;line-height: 70rpx;">
						<!-- <text
							class="text-orange">{{item.Row_Status == '0'?'审核中':item.Row_Status=='1'?'已通过':item.Row_Status=='2'?'未通过':item.Row_Status=='4'&&item.Buyer_Status == '4'?'待对方发货':item.Row_Status=='4'&&item.Buyer_Status != '4'?'待对方确认':item.Row_Status=='5'?'对方已发货':item.Row_Status=='6'?'已收货':item.Row_Status=='7'?'已结束':""}}</text> -->
							<text v-if="item.Row_Status == '0'">审核中</text>
							<text v-if="(item.Row_Status == '1'||item.Row_Status == '4')&&item.Buyer_Status=='0'">待确认合同</text>
							<text v-if="item.Row_Status == '1'&&item.Buyer_Status=='4'">待对方确认</text>
							<text v-if="item.Row_Status == '4'&&item.Buyer_Status=='4'&&item.Paystages.split('/')[0]=='0'">待付首款</text>
							<text v-if="item.Row_Status == '4'&&item.Buyer_Status=='4'&&item.Paystages.split('/')[0]=='1'">待发货</text>
							<text v-if="item.Row_Status == '5'">待收货</text>
							<text v-if="item.Row_Status == '6'&&item.Pay_Status=='0'">待付剩余款</text>
							<text v-if="item.Row_Status == '6'&&item.Pay_Status=='1'">交易结束</text>
					</view>
					<view class="flex align-center justify-center" style="width: 8%;line-height: 70rpx;">
						<text class="text-orange">{{item.Pay_Status=='1'?'是':'否'}}</text>
					</view>
					<view class="flex align-center" style="width: 16%;line-height: 70rpx;">
						<button @click="seeDetail(index,item.Group_Transaction_SerialNumber,item.Trading_Type)"
							class="uni-button font-sm bg-success text-white flex justify-center align-center"
							style="white-space: nowrap; width:30%;height: 100rpx;margin-right: auto;">详情</button>
						<button v-if="(item.Row_Status=='1'||item.Row_Status=='4')&&item.Buyer_Status!='4'"
							@click="getDetail(item.Group_Transaction_SerialNumber)"
							class="uni-button font-sm bg-blue text-white flex justify-center align-center"
							style="white-space: nowrap; width:30%;height: 100rpx;margin-right: auto;">确认合同</button>
						<button v-if="item.Row_Status=='5'" @click="ConfirmReceipt(item)"
							class="uni-button font-sm bg-danger text-white flex justify-center align-center"
							style="white-space: nowrap; width:30%;height: 100rpx;margin-right: auto;">确认收货</button>
					</view>
				</view>
			</view>
		</view>
		<view v-else class=" bg-white p-4" style="width: 2000rpx;">
			<view class="flex w-100 justify-between">
				<text class="font-weight-bold">商品信息</text>
				<view class="">
					<button @click="seeDetail(0)" size="mini" class="uni-button" type="primary">返回上一页</button>
				</view>
			</view>
			<view class="flex justify-between" style="width: 50%;">
				<image style="height: 300rpx;" :src="Domain_IMG + List.Picture_URL" mode="heightFix"></image>
				<view class="flex flex-column">
					<text>商品名:{{List.Article_Name}}</text>
					<text>所属企业:{{List.Enterprise_Name}}</text>
					<text>单价:￥{{List.Amount}}/{{List.Article_Unit_SerialNumber}}</text>
					<text>购买数量:{{List.Quantity}}{{List.Article_Unit_SerialNumber}}</text>
					<text>总花费:￥{{List.Quantity * List.Amount}}</text>
					<text>交易时间:{{List.Submission_Time}}</text>
					<text>联系人:{{List.Contacts}}</text>
					<text>联系人手机号:{{List.Contacts_Phone}}</text>
				</view>
			</view>
			<text class="font-weight-bold">物流追踪</text>
			<view class="flex mb-2">
				<uni-steps :active-color="'#fc7c08'" :options="list2" :active="active1" direction="column" />
			</view>
			<text class="font-weight-bold">进行付款</text>
			<view class="">
				<view v-if="Trading_Type=='1'" class="flex flex-column">
					<view v-for="(item,i) in TradingWay" :key="i" class="flex align-center w-100 p-2"
						style="justify-content: space-evenly;">
						<view class="">
							<text class="font-md font-weight-bold">付款阶段:</text>
							<text class="font-sm ml-2">{{item.Trading_Name}}</text>
						</view>
						<view class="">
							<text class="font-md font-weight-bold">付款额度:</text>
							<text class="font-sm text-orange ml-2">{{item.Trading_Amount}}%</text>
						</view>
						<view class="">
							<text class="font-md font-weight-bold">最晚付款时间:</text>
							<text class="font-sm ml-2">{{item.Trading_Date}}</text>
						</view>
						<view class="">
							<button @click="toggle('center',item.Group_Paystages_SerialNumber)" v-if="item.Row_Status=='0'" size="mini" type="primary"
								class="uni-button">选择付款方式</button>
							<button v-else size="mini" type="warn" class="uni-button">已付款</button>
						</view>
					</view>
				</view>
				<view v-else class="flex align-center justify-center">
					<view class="">
						<text class="font-md font-weight-bold">全额付款:</text>
						<text class="font-sm ml-2">{{List.Trading_Node}}即付款</text>
					</view>
					<view  class="ml-2">
						<button @click="toggle('center')" size="mini" type="primary" class="uni-button">选择付款方式</button>
					</view>
				</view>
			</view>
			<view class="">
				<uni-popup ref="popup" background-color="#fff" @change="change">
					<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }">
						<view class="flex flex-column align-center justify-center"
							style="width: 1000rpx;height: 800rpx;">
							<text class="text-center mb-2 font-weight-bold h2">请选择支付方式</text>
							<radio-group class="flex w-100" style="justify-content: space-around;"
								@change="radioChange">
								<label class="uni-list-cell uni-list-cell-pd flex justify-center"
									v-for="(item, index) in items" :key="item.value">
									<view class="flex align-center flex-column">
										<image style="width: 100rpx;" :src="item.Image" mode="widthFix"></image>
										<radio :value="item.value" :checked="index === current" />
										<view>{{item.name}}</view>
									</view>
								</label>
							</radio-group>
							<view class="mt-3 flex justify-center">
								<view class="flex align-center flex-column" v-if="payWay!='E-invoicing'">
									<uqrcode ref="uqrcode" canvas-id="qrcode" :value="payURL" :options="{ margin: 10 }">
									</uqrcode>
									<button @click="getOr(List)" class="uni-button" type="primary"
										size="mini">支付完成后点击此处</button>
								</view>
								<view v-else class="example-body flex justify-center flex-column align-center">
									<uni-file-picker :image-styles="imageStyles" limit="1"
										title="请上传电子发票"></uni-file-picker>
									<button @click="submit(List)" class="uni-button" type="primary"
										size="mini">提交</button>
								</view>
							</view>
						</view>
					</view>
				</uni-popup>
			</view>
		</view>
		<Notify :type="type" :content="message" :show="LetterCommitment"></Notify>
	</view>
</template>

<script>
	import times from '@/mixins/time.js'
	import Notify from '@/components/Notify/Notify.vue'
	const app = getApp()
	export default {
		name: "OrderAll",
		data() {
			return {
				Domain_IMG: app.globalData.Domain_IMG,
				disabled: false,
				single: '',
				an: [],
				type: 'info',
				message: '',
				LetterCommitment: false,
				jd: 0,
				jdx: 0,
				show: true,
				formData: {
					Group_Transaction_SerialNumber: "", //主键
					Group_Purchasing_SerialNumber: "", //流水号
					Quantity: "", //总量
					Amount: "", //钱
					Submission_Time: "", //时间
					Trading_Type: "",
					Group_Purchasing_Payment_SerialNumber: "",
					Group_Purchasing_Shipment_SerialNumber: "",
					Group_Purchasing_Transport_SerialNumber: "",
					Buyer_Contact: "", //买主姓名
					Buyer_Contact_Phone: "", //买主手机号
					Buyer_Enterprise_Info_SerialNumber: "", //买主公司编号
					Enterprise_Info_SerialNumber: "", //卖家公司编号
				},
				form: {
					// Article_Name: "",
					Type: "0",
					Group_Purchasing_SerialNumber: '',
					token: "",
					Enterprise_Info_SerialNumber: "",
					page: 1, //页数
					limit: 10, //每页数据条数
				},
				PaystagesData: [],
				RightTopNav: [{
						name: '所有交易',
						num: 0,
					},
					{
						name: '审核中',
						num: 0,
					},
					{
						name: '已通过',
						num: 0,
					},
					{
						name: '未通过',
						num: 0,
					},
					{
						name: '待对方确认',
						num: 0,
					},
					{
						name: '待收货',
						num: 0,
					},
				],
				list2: [{
					title: '审核中',
					desc: '2023-11-04'
				}, {
					title: '已通过',
					desc: '预计2023-11-12'
				}, {
					title: '未通过',
					desc: '预计2023-11-13'
				}, {
					title: '待对方确认',
					desc: '预计2023-11-14'
				}, {
					title: '待对方收货',
					desc: '预计2023-11-14'
				}, {
					title: '对方已收货',
					desc: '预计2023-11-14'
				}],
				type: 'center',
				payURL: '',
				NewListData: [],
				limit: 0,
				ListData: [],
				List: [],
				active: 0,
				active1: 0,
				TradingWay: [],
				items: [{
						value: 'wx',
						name: '微信',
						checked: 'true',
						Image: '/static/WXlogo.png'
					},
					{
						value: 'zfb',
						name: '支付宝',
						Image: '/static/zfb.png'
					},
					{
						value: 'E-invoicing',
						name: '电子汇账',
						Image: '/static/dzhz.png'
					},
				],
				Trading_Type: '0',
				payWay: 'wx',
				current: 0,
				ispay: true,
				imageStyles: {
					width: 150,
					height: 150,
					border: {
						width: 2,
						style: 'dashed',
						radius: '2px'
					}
				},
			};
		},
		components: {
			Notify
		},
		methods: {
			select(i) {
				if (this.active == i) {
					return
				}
				this.active = i
				if (i == 0) {
					this.getListData(this.form)
				} else if (i == 1) {
					var arr = []
					this.ListData.forEach(item => {
						if (item.Row_Status == '0') {
							arr.push(item)
						}
					})
					this.NewListData = arr
				} else if (i == 2) {
					var arr = []
					this.ListData.forEach(item => {
						if (item.Row_Status == '1') {
							arr.push(item)
						}
					})
					this.NewListData = arr
				} else if (i == 3) {
					var arr = []
					this.ListData.forEach(item => {
						if (item.Row_Status == '2') {
							arr.push(item)
						}
					})
					this.NewListData = arr
				} else if (i == 4) {
					var arr = []
					this.ListData.forEach(item => {
						if (item.Row_Status == '4') {
							arr.push(item)
						}
					})
					this.NewListData = arr
				} else if (i == 5) {
					var arr = []
					this.ListData.forEach(item => {
						if (item.Row_Status == '5') {
							arr.push(item)
						}
					})
					this.NewListData = arr
				}
			},
			getListData(data) {
				uni.request({ //生成消耗订单
					url: app.globalData.Domain_Name + '/getGroupTransactionAllAction',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data,
					success: (res) => {
						console.log(res.data);
						this.limit = res.data.limit
						this.RightTopNav[0].num = this.limit
						this.ListData = res.data.tableData
						this.NewListData = this.ListData
						var a = 0
						var b = 0
						var c = 0
						var d = 0
						var e = 0
						this.ListData.forEach(item => {
							if (item.Row_Status == '0') {
								a++
							} else if (item.Row_Status == '1') {
								b++
							} else if (item.Row_Status == '2') {
								c++
							} else if (item.Row_Status == '4') {
								d++
							} else if (item.Row_Status == '5') {
								e++
							}
						})
						this.RightTopNav[1].num = a
						this.RightTopNav[2].num = b
						this.RightTopNav[3].num = c
						this.RightTopNav[4].num = d
						this.RightTopNav[5].num = e
					}
				})
			},
			rdc(id) {
				this.NewOrderData.splice(0, 1)
				uni.setStorageSync('OrderData', this.NewOrderData)
				this.getNav()
			},
			seeDetail(i, Group_Transaction_SerialNumber, Trading_Type) {
				uni.setStorageSync('keys', Group_Transaction_SerialNumber)
				this.show = !this.show
				this.Trading_Type = Trading_Type
				this.List = this.NewListData[i]
				if (this.List.Row_Status == '0') {
					this.active1 = 0
				} else if (this.List.Row_Status == '1') {
					this.active1 = 1
				} else if (this.List.Row_Status == '2') {
					this.active1 = 2
				} else if (this.List.Row_Status == '4') {
					this.active1 = 3
				} else if (this.List.Row_Status == '5') {
					this.active1 = 4
				} else if (this.List.Row_Status == '6') {
					this.active1 = 5
				}
				this.Select(Group_Transaction_SerialNumber)
			},
			maskClick(e) {
				console.log('maskClick事件:', e);
			},
			getNav() {
				this.RightTopNav[0].num = this.limit
			},
			goPay() {
				console.log('付款')
			},
			change(e) {
				console.log('当前模式：' + e.type + ',状态：' + e.show);
			},
			toggle(type, Group_Paystages_SerialNumber) {
				this.type = type
				// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
				this.$refs.popup.open(type)
				this.codeUrl(Group_Paystages_SerialNumber)
				uni.setStorageSync('Paystages_SerialNumber', Group_Paystages_SerialNumber)
			},
			radioChange: function(evt) {
				console.log(evt)
				this.payWay = evt.detail.value
				for (let i = 0; i < this.items.length; i++) {
					if (this.items[i].value === evt.detail.value) {
						this.current = i;
						break;
					}
				}
			},
			Select(key) {
				var token = uni.getStorageSync('token')
				var Enterprise_Info_SerialNumber = uni.getStorageSync('enterprise')
				console.log(Enterprise_Info_SerialNumber)
				uni.request({ //查询
					url: app.globalData.Domain_Name + '/GoodsInquiryKey',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						Primary_Key_Name: 'Group_Transaction_SerialNumber', //主键名
						Primary_Key: key, //主键值
						Data: 'group_transaction_paystages',
					},
					success: (res) => {
						console.log(res.data);
						this.TradingWay = res.data
					}
				})
			},
			ConfirmReceipt(item) {
				var token = uni.getStorageSync('token')
				item.Row_Status = '6'
				uni.request({ //查询
					url: app.globalData.Domain_Name + '/GroupTransactionStateAction',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						Group_Transaction_SerialNumber: item.Group_Transaction_SerialNumber, //主键名
						token,
					},
					success: (res) => {
						console.log(res.data);
						this.type = "success"
						this.message = '收货成功'
						this.LetterCommitment = true
						setTimeout(() => {
							this.LetterCommitment = false
						}, 2000)
						this.getListData(this.form)
						this.SendMessage(`收货成功`)
					}
				})
			},
			getDetail(Group_Transaction_SerialNumber) {
				uni.showLoading({
					title:'提交中...'
				})
				this.disabled = true
				var token = uni.getStorageSync('token')
				let _this = this;
				let obj = {
					// 采购信息表
					group_transaction: {
						group_transaction_paystages: {}
					}
				}
				uni.request({
					url: app.globalData.Domain_Name + '/getSubtableInquiryOriginal',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						Primary_Key: Group_Transaction_SerialNumber,
						JSONObject: JSON.stringify(obj),
						token,
					},
					success: (res) => {
						this.formData = res.data.group_transaction[0]
						this.ConfirmContract(token)
					}
				})
			},
			ConfirmContract(token) { //确认合同
				var Enterprise_Info_SerialNumber = uni.getStorageSync('enterprise')
				console.log(this.formData)
				this.formData.Buyer_Status = '4'
				var group_message_buyer = {
					Group_Message_SerialNumber: "",
					Group_Transaction_SerialNumber: this.formData.Group_Transaction_SerialNumber,
					Cause: "确认合同",
					Submission_Time: times.nowtime(),
					Enterprise_Info_SerialNumber,
					Seller_Type: "0"
				}
				let data = {
					Data: JSON.stringify({
						Modify: {
							group_transaction: [this.formData]
						},
						Add: {
							group_message: [group_message_buyer]
						}
					}),
					token,
				}
				uni.request({
					url: app.globalData.Domain_Name + '/getEditAction',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data,
					success: (res) => {
						uni.hideLoading()
						console.log(res.data)
						this.disabled = false
						if (res.data.Status == 'success') {
							this.type = 'success',
								this.message = '已确认合同'
							this.LetterCommitment = true
							this.getListData(this.form)
							setTimeout(() => {
								this.LetterCommitment = false
							}, 2000)
							this.SendMessage(`已确认合同`)
						}
					}
				})
			},
			submit() {
				uni.showLoading({
					title: '提交中...'
				})
				setTimeout(() => {
					uni.hideLoading()
					this.type = 'success'
					this.message = '上传成功'
					this.LetterCommitment = true
					setTimeout(() => {
						this.LetterCommitment = false
					}, 2000)
					this.$refs.popup.close()
				}, 2000)
				var token = uni.getStorageSync('token')
				var Primary_Key = uni.getStorageSync('Paystages_SerialNumber')
				uni.request({
					url: app.globalData.Domain_Name + '/GoodsInquiryKeyOriginal',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						Primary_Key_Name: 'Group_Paystages_SerialNumber', //主键名
						Primary_Key, //主键值
						Data: 'group_transaction_paystages',
					},
					success: (res) => {
						console.log(res);
						this.PaystagesData = res.data
						this.set(token)
					}
				})
			},
			set(token) {
				this.PaystagesData[0].Row_Status = 1
				this.PaystagesData[0].Collection_Amount = 0.01
				let data = {
					Data: JSON.stringify({
						Modify: {
							group_transaction_paystages: this.PaystagesData
						},
					}),
					token,
				}
				uni.request({
					url: app.globalData.Domain_Name + '/getEditAction',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data,
					success: (res) => {
						console.log(res);
						var key = uni.getStorageSync('keys')
						this.Select(key)
					}
				})
			},
			codeUrl(Group_Paystages_SerialNumber) {
				var token = uni.getStorageSync('token')
				uni.request({
					url: app.globalData.Domain_Name + '/GroupWeChatNativeText',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						token,
						Group_Paystages_SerialNumber,
					},
					success: (res) => {
						console.log(res);
						this.payURL = res.data.code_url
					}
				})
			},
			SendMessage(value) {
				uni.request({
					url: app.globalData.Domain_Name + '/WeChatSendCustom',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						value,
					},
					success: (res) => {
						console.log(res.data)
					}
				})
			},
			getOr(data) {
				uni.showLoading({
					title:'提交中...'
				})
				this.disabled = true
				var token = uni.getStorageSync('token')
				let _this = this;
				let obj = {
					// 采购信息表
					group_transaction: {
						group_transaction_paystages: {}
					}
				}
				uni.request({
					url: app.globalData.Domain_Name + '/getSubtableInquiryOriginal',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data: {
						Primary_Key: data.Group_Transaction_SerialNumber,
						JSONObject: JSON.stringify(obj),
						token,
					},
					success: (res) => {
						var key = uni.getStorageSync('keys')
						this.Select(key)
						var Enterprise_Info_SerialNumber = this.List.Enterprise_Info_SerialNumber
						this.formData = res.data.group_transaction[0]
						this.off(Enterprise_Info_SerialNumber, this.formData)
					}
				})
			},
			off(Enterprise_Info_SerialNumber, item) {
				var token = uni.getStorageSync('token')
				this.$refs.popup.close()
				this.formData.Row_Status = '7'
				var group_message_buyer = {
					Group_Message_SerialNumber: "",
					Group_Transaction_SerialNumber: item.Group_Transaction_SerialNumber,
					Cause: "对方已付款",
					Submission_Time: times.nowtime(),
					Enterprise_Info_SerialNumber,
					Seller_Type: "1"
				}
				console.log(group_message_buyer)
				// let data = {
				// 	Data: JSON.stringify({
				// 		group_message: [group_message_buyer]
				// 	}),
				// 	token,
				// }
				let data = {
					Data: JSON.stringify({
						group_message: [group_message_buyer]
					}),
					token,
				}
				uni.request({
					url: app.globalData.Domain_Name + '/getAddAction',
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					},
					method: "POST",
					data,
					success: (res) => {
						uni.hideLoading()
						console.log(res.data)
						this.disabled = false
					}
				})
			}
		},
		mounted() {
			this.getNav()
			this.form.Enterprise_Info_SerialNumber = uni.getStorageSync('enterprise')
			this.form.token = uni.getStorageSync('token')
			this.getListData(this.form)
		}
	}
</script>

<style lang="scss">
	.active {
		color: #f00;
		border-bottom-color: #f00;
		border-bottom-width: 6rpx;
		border-bottom-style: solid;
	}

	.example-body {
		padding: 10px;
		padding-top: 0;
	}

	@mixin flex {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	@mixin height {
		/* #ifndef APP-NVUE */
		height: 100%;
		/* #endif */
		/* #ifdef APP-NVUE */
		flex: 1;
		/* #endif */
	}

	.box {
		@include flex;
	}

	.button {
		@include flex;
		align-items: center;
		justify-content: center;
		flex: 1;
		height: 35px;
		margin: 0 5px;
		border-radius: 5px;
	}

	.example-body {
		background-color: #fff;
	}

	.button-text {
		color: #fff;
		font-size: 12px;
	}

	.popup-content {
		@include flex;
		align-items: center;
		justify-content: center;
		padding: 15px;
		background-color: #fff;
	}

	.popup-height {
		@include height;
		width: 200px;
	}

	.text {
		font-size: 12px;
		color: #333;
	}

	.popup-success {
		color: #fff;
		background-color: #e1f3d8;
	}

	.popup-warn {
		color: #fff;
		background-color: #faecd8;
	}

	.popup-error {
		color: #fff;
		background-color: #fde2e2;
	}

	.popup-info {
		color: #fff;
		background-color: #f2f6fc;
	}

	.success-text {
		color: #09bb07;
	}

	.warn-text {
		color: #e6a23c;
	}

	.error-text {
		color: #f56c6c;
	}

	.info-text {
		color: #909399;
	}

	.dialog,
	.share {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
	}

	.dialog-box {
		padding: 10px;
	}

	.dialog .button,
	.share .button {
		/* #ifndef APP-NVUE */
		width: 100%;
		/* #endif */
		margin: 0;
		margin-top: 10px;
		padding: 3px 0;
		flex: 1;
	}

	.dialog-text {
		font-size: 14px;
		color: #333;
	}
</style>